package com.example.commonbiz

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import kotlinx.coroutines.launch

class UserViewModel : ViewModel() {
    private val repository = UserRepository()
    val user = MutableLiveData<User?>()

    fun fetchUser(userId: Int) {
        viewModelScope.launch {
            user.value = repository.getUser(userId)
        }
    }
}